Skip to content

Use a hardcoded constant instead of calling OpenProcessToken.#119032

Merged
bors merged 2 commits intorust-lang:masterfrom
smmalis37:patch-1
Feb 17, 2024
Merged

Use a hardcoded constant instead of calling OpenProcessToken.#119032
bors merged 2 commits intorust-lang:masterfrom
smmalis37:patch-1

Conversation

@smmalis37
Copy link
Copy Markdown
Contributor

Now that Win 7 support is dropped, we can resurrect #90144.

GetCurrentProcessToken is defined in processthreadsapi.h as:

FORCEINLINE
HANDLE
GetCurrentProcessToken (
VOID
)
{
return (HANDLE)(LONG_PTR) -4;
}

Since it's very unlikely that this constant will ever change, let's just use it instead of making calls to get the same information.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-windows Operating system: Windows S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants